<?php
session_start();

date_default_timezone_set('America/Recife');
include_once 'class/banco_cliente.php';
include_once 'class/consulta.php';
if (!$_SESSION['logado']) {
    header('location: index.php');
    die();
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $request = md5(implode($_POST));
    if (isset($_SESSION['last_request']) && ($_SESSION['last_request'] == $request)) {
        $refresh = true;
    } else {
        $_SESSION['last_request'] = $request;
        $refresh = false;
    }
} else {
    $_SESSION['last_request'] = '';
    $refresh = false;
}
include_once 'class/banco_cliente.php';
if (isset($_GET['p'])) {
    $menu = substr($_GET['p'], 3, 3);
    if (isset($_GET['opcao']))
        $menu .= '_' . $_GET['opcao'];
}
else {
    $menu = '';
}
if (isset($_GET['m'])) {
    $menu = $_GET['m'];
}

$guid = $_SESSION['ori_usuario']['id_grupo'];
?>
<!DOCTYPE HTML>
<html lang="pt-BR">
<head>
<meta charset="utf-8">
<title>ORION - $Prósper@ Empreendimentos</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="ORION - $Prósper@ Empreendimentos">
<meta name="author" content="Kleilson">
<!-- styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/jquery.gritter.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="css/font-awesome.css">
<!--[if IE 7]>
<link rel="stylesheet" href="css/font-awesome-ie7.min.css">
<![endif]-->
<link href="css/tablecloth.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<link href="css/responsive-tables.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="css/ie/ie7.css" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="css/ie/ie8.css" />
<![endif]-->
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="css/ie/ie9.css" />
<![endif]-->
<link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'>
<!--fav and touch icons -->
<link rel="shortcut icon" href="ico/favico.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">
<!--============ javascript ===========-->
<script src="js/jquery.js"></script>
<script src="js/jquery-ui-1.10.1.custom.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/jquery.sparkline.js"></script>
<script src="js/bootstrap-fileupload.js"></script>
<script src="js/jquery.metadata.js"></script>
<script src="js/jquery.tablesorter.min.js"></script>
<script src="js/jquery.tablecloth.js"></script>
<script src="js/jquery.flot.js"></script>
<script src="js/jquery.flot.selection.js"></script>
<script src="js/excanvas.js"></script>
<script src="js/jquery.flot.pie.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.time.js"></script>
<script src="js/jquery.flot.tooltip.js"></script>
<script src="js/jquery.flot.resize.js"></script>
<script src="js/jquery.collapsible.js"></script>
<script src="js/accordion.nav.js"></script>
<script src="js/jquery.gritter.js"></script>
<script src="js/tiny_mce/jquery.tinymce.js"></script>
<script src="js/custom.js"></script>
<script src="js/respond.min.js"></script>
<script src="js/ios-orientationchange-fix.js"></script>
<script src="js/responsive-tables.js"></script>
<script src="js/jquery.inputmask.min.js"></script>
<script src="js/jquery.maskMoney.js"></script>

<!-- DIALOG -->
<script src="js/bootbox.js"></script>
<!-- DATETIMEPICKER -->
<script src="js/bootstrap-datetimepicker.min.js"></script>
<!-- FIM DATETIMEPICKER -->

<!-- PARA LISTAGENS DAS TABELAS -->
<script src="js/jquery.dataTables.js"></script>
<script src="js/ZeroClipboard.js"></script>
<script src="js/dataTables.bootstrap.js"></script>
<script src="js/TableTools.js"></script>

<!-- ====Select Box==== -->
<link href="css/chosen.css" rel="stylesheet">
<script src="js/chosen.jquery.js"></script>
<script type="text/javascript">
/*====Select Box====*/
    $(function () {
        $(".chzn-select").chosen();
        $(".chzn-select-deselect").chosen({
            allow_single_deselect: true
        });
    });
</script>
<!-- ==== Fim Select Box ==== -->

<script type="text/javascript">
            /*$( function () {
		  // Set the classes that TableTools uses to something suitable for Bootstrap
		  $.extend( true, $.fn.DataTable.TableTools.classes, {
			  "container": "btn-group",
			  "buttons": {
				  "normal": "btn",
				  "disabled": "btn disabled"
			  },
			  "collection": {
				  "container": "DTTT_dropdown dropdown-menu",
				  "buttons": {
					  "normal": "",
					  "disabled": "disabled"
				  }
			  }
		  } );
		  // Have the collection use a bootstrap compatible dropdown
		  $.extend( true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {
			  "collection": {
				  "container": "ul",
				  "button": "li",
				  "liner": "a"
			  }
		  } );
		  });
		  */
            $(function () {
                $('#data-table').dataTable({
                    "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>"
                    /*"oTableTools": {
			"aButtons": [
				"copy",
				"print",
				{
					"sExtends":    "collection",
					"sButtonText": 'Save <span class="caret" />',
					"aButtons":    [ "csv", "xls", "pdf" ]
				}
			]
		}*/
                });
            });
            $(function () {
                $('.tbl-simple').dataTable({
                    "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>"
                });
            });
			
			$(function () {
			$(".tbl-paper-theme").tablecloth({
          theme: "paper"
		   });
			});
			
		$(function () {
			$(".tbl-dark-theme").tablecloth({
          theme: "dark"
		   });
		});
			$(function () {
                $('.tbl-paper-theme,.tbl-dark-theme').dataTable({
                    "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>"
                });
	

            });
</script>
<!-- FIM PARA LISTAGENS DAS TABELAS -->
<script>
/*===============================================
TEXT EDITOR
==================================================*/
        $(function() {
		$('textarea.chat-inputbox').tinymce({
			script_url : 'js/tiny_mce/tiny_mce.js',
			theme : "simple"
			});
		});
/*===============================================
TBALE THEMES
==================================================*/
$(function() {
        $(".paper-table").tablecloth({
          theme: "paper",
          striped: true,
          sortable: true,
          condensed: false
        });
      });
	  
$(function(){
		// global setting override
        /*
		$.extend($.gritter.options, {
		    class_name: 'gritter-light', // for light notifications (can be added directly to $.gritter.add too)
		    position: 'bottom-left', // possibilities: bottom-left, bottom-right, top-left, top-right
			fade_in_speed: 100, // how fast notifications fade in (string or int)
			fade_out_speed: 100, // how fast the notices fade out
			time: 3000 // hang on the screen for...
		});
        */
/**=========================
ONLOAD NOTIFICATION 
==============================**/
		$(window).load(function() {
			/*var unique_id = $.gritter.add({
				// (string | mandatory) the heading of the notification
				title: 'This is a sticky notice!',
				// (string | mandatory) the text inside the notification
				text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.',
				// (string | optional) the image to display on the left
				image: 'images/notification-thumb.png',
				// (bool | optional) if you want it to fade out on its own or just sit there
				sticky: false,
				// (int | optional) the time you want it to be alive for before fading out
				time: '10000',
				// (string | optional) the class name you want to apply to that specific message
				class_name: 'my-sticky-class'
			});*/
			// You can have it return a unique id, this can be used to manually remove it later using
			/*
			setTimeout(function(){
				$.gritter.remove(unique_id, {
					fade: true,
					speed: 'slow'
				});
			}, 6000)
			*/
			return false;
		});
		
		<?
			if(!$_SESSION['boas_vindas']){
				echo'
					$.gritter.add({
						// (string | mandatory) the heading of the notification
						title: "Seja bem vindo!",
						// (string | mandatory) the text inside the notification
						text: "Até aqui nos ajudou o Senhor! <br> Salmos 26:3 e I Samuel 7.12"
					});
					return false;
				';
				$_SESSION['boas_vindas'] = 1;
			}
		?>
});
/**=========================
SPARKLINE MINI CHART
==============================**/
$(function () {
    $(".line-min-chart").sparkline([50, 10, 2, 3, 40], {
        type: 'line',
        width: '80',
        height: '40',
        lineColor: '#2b2b2b',
        fillColor: '#e5e5e5',
        lineWidth: 2,
        highlightSpotColor: '#0e8e0e',
        spotRadius: 3,
        drawNormalOnTop: true
    });
    $(".bar-min-chart").sparkline([50, 10, 2, 3, 40, 5, 26, 10, -15, 20, 40, 60], {
        type: 'bar',
        height: '40',
        barWidth: 4,
        barSpacing: 1,
        barColor: '#007f00'
    });
    $(".pie-min-chart").sparkline([45, 45, 75, 70], {
        type: 'pie',
        width: '60',
        height: '60'
    });
    $(".tristate-min-chart").sparkline([1, 1, 0, 1, -1, -1, 1, -1, 0, 0, 1, 1], {
        type: 'tristate',
        height: '40',
        posBarColor: '#bf005f',
        negBarColor: '#ff7f00',
        zeroBarColor: '#545454',
        barWidth: 4,
        barSpacing: 1
    });
});
/**=========================
LEFT NAV ICON ANIMATION 
==============================**/
$(function () {
    $(".left-primary-nav a").hover(function () {
        $(this).stop().animate({
            fontSize: "30px"
        }, 200);
    }, function () {
        $(this).stop().animate({
            fontSize: "24px"
        }, 100);
    });
});
</script>
<script type="text/javascript">
/*===============================================
FLOT BAR CHART
==================================================*/

    var data7_1 = [
		[1, 56],
        [2, 34],
        [3, 7],
        [4, 68],
        [5, ],
        [6, ],
        [7, ],
        [8, ],
        [9, ],
        [10, ],
        [11, ],
        [12, ],
        [13, ],
        [14, ],
        [15, ],
        [16, ],
        [17, ],
        [18, ],
        [19, ],
        [20, ],
        [21, ],
        [22, ],
        [23, ],
        [24, ],
        [25, ],
        [26, ],
        [27, ],
        [28, ],
        [29, ],
        [30, ],
        [31, ]
    ];
    var data7_2 = [
		[1, 4],
        [2, 67],
        [3, 23],
        [4, 34],
        [5, ],
        [6, ],
        [7, ],
        [8, ],
        [9, ],
        [10, ],
        [11, ],
        [12, ],
        [13, ],
        [14, ],
        [15, ],
        [16, ],
        [17, ],
        [18, ],
        [19, ],
        [20, ],
        [21, ],
        [22, ],
        [23, ],
        [24, ],
        [25, ],
        [26, ],
        [27, ],
        [28, ],
        [29, ],
        [30, ],
        [31, ]
    ];
    $(function () {
        $.plot($("#visitors-chart #visitors-container"), [{
            data: data7_1,
            label: "Próspera",
            lines: {
                show: true//fill: true
            }
        }, {
            data: data7_2,
            label: "Kf Viagens",
            points: {
                show: true
            },
            lines: {
                show: true
            },
            yaxis: 1//2
        }
        ],
        {
            series: {
                lines: {
                    show: true,
                    fill: false
                },
                points: {
                    show: true,
                    lineWidth: 2,
                    fill: true,
                    fillColor: "#ffffff",
                    symbol: "circle",
                    radius: 5,
                },
                shadowSize: 0,
            },
            grid: {
                hoverable: true,
                clickable: true,
                tickColor: "#f9f9f9",
                borderWidth: 1
            },
            colors: ["#b086c3", "#ea701b"],
            tooltip: true,
            tooltipOpts: {
				  shifts: { 
					  x: -100                    //10
				  },
                defaultTheme: false
            },
            xaxis: [{
                mode: "time",
                timeformat: "%d/%m"
            }, {
                /* Second x axis */
                position: "left" /* left or right */
            }],
            yaxes: [{
                /* First y axis */
            }, {
                /* Second y axis */
                position: "right" /* left or right */
            }]
        }
        );
    });
</script>
<script type="text/javascript">
/*===============================================
FLOT PIE CHART
==================================================*/

    $(function () {
        var data = [{
            label: "Page View",
            data: 900
        }, {
            label: "Online User",
            data: 30
        }];
        var options = {
            series: {
                pie: {
                    show: true,
					innerRadius: 0.5,
            show: true
                }
            },
            legend: {
                show: true
            },
            grid: {
                hoverable: true,
                clickable: true
            },
			 colors: ["#b086c3", "#ea701b"],
            tooltip: true,
            tooltipOpts: {
				shifts: { 
					  x: -100                     //10
				  },
                defaultTheme: false
            }
        };
        $.plot($("#pie-chart-donut #pie-donutContainer"), data, options);
    });
</script>
</head>
<body>
<div class="layout"> 
  <!-- Navbar
    ================================================== -->
  <div class="navbar navbar-inverse top-nav">
    <div class="navbar-inner">
      <div class="container"> <a class="brand" href="page.php"><img src="images/orion_logo.png" width="140" height="47" alt="&Oacute;rion"></a>
        <div class="btn-toolbar pull-right notification-nav">
          <div class="btn-group">
            <div class="dropdown"> <a class="btn btn-notification dropdown-toggle" data-toggle="dropdown"><i class="icon-globe"><span class="notify-tip">3</span></i></a>
              <div class="dropdown-menu pull-right ">
              	<span class="notify-h"> Você tem 3 notificações</span>
                <a href="?p=admContacCenter&opcao=list_ani&op_menu=ani" class="msg-container clearfix">
                	<span class="notification-thumb">
                    	<i class="icon-gift icon-large"></i>
                    </span>
                    <span class="notification-intro"> Kleilson de sousa nogueira está completando ano hoje.
                    <span class="notify-time"> 3 Horas Jan </span>
                   	</span>
                </a>
                <a class="msg-container clearfix">
                	<span class="notification-thumb">
                    	<img src="images/notify-thumb.png" width="50" height="50" alt="user-thumb">
                    </span>
                    <span class="notification-intro"> As notificações representadas por este icone, serão enviados por administradores.
                    <span class="notify-time"> 3 Horas Jan </span>
                   	</span>
                </a>
                <a class="msg-container clearfix">
                	<span class="notification-thumb">
                    	<img src="images/user-thumb.png" width="50" height="50" alt="user-thumb">
                    </span>
                    <span class="notification-intro"> As notificações representadas por este icone, serão enviados por usuários.
                    <span class="notify-time"> 3 Horas Jan </span>
                   	</span>
                </a>
                <a href="javascript:void(0);" class="btn btn-info btn-large btn-block">Ver todas</a>
              </div>
            </div>
          </div>
          <div class="btn-group">
            <div class="dropdown"> <a class="btn btn-notification"><i class="icon-envelope-alt"></i></a> </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="leftbar leftbar-close clearfix">
    <div class="admin-info clearfix">
      <div class="admin-thumb"> <i class="icon-user"></i><!--<img src="images/users/kleilson.jpg">--> </div>
      <div class="admin-meta">
        <ul>
          <li class="admin-username">
            <?= $_SESSION['ori_usuario']['USU_NOME'] ?>
          </li>
          <li><a href="?p=admusuarios&opcao=perfil_usu">Perfil </a></li>
          <li><a href="index.php">Sair <i class="icon-lock"></i></a></li>
        </ul>
      </div>
    </div>
    <div class="left-nav clearfix">
      <div class="left-primary-nav"> 
        <!-- MENU LATERAL -->
        <ul id="myTab">
          <? $arr_cad = array('Con'); ?>
          <!--<li <?= startsWith($menu, $arr_cad) ? 'class="active"' : ''; ?> ><a href="#forms" class="icon-group" title="CLIENTES"></a></li>
          <li><a href="#contratos" class="icon-file-alt" title="CONTRATOS"></a></li>-->
          <li <?= startsWith($menu, 'Con') ? 'class="active"' : ''; ?>><a href="#ui-elements" class="icon-comments-alt" title="CONTACT CENTER"></a></li>
          <!--<li><a href="#relatorios" class="icon-bar-chart" title="RELATÓRIOS"></a></li>
          <li><a href="#simulador" class="icon-money" title="SIMULADOR"></a></li>
          <li><a href="#recibos" class="icon-copy" title="RECIBOS"></a></li>-->
          <li><a href="#config" class="icon-cogs" title="CONFIGURAÇÕES"></a></li>
        </ul>
        <!-- FIM MENU LATERAL --> 
      </div>
      <div class="responsive-leftbar"> <i class="icon-list"></i> </div>
      <div class="left-secondary-nav tab-content">
        <div class="tab-pane" id="forms">
          <h4 class="side-head">CLIENTES</h4>
          <ul id="nav" class="accordion-nav">
            <li><a href="importacao.html"><i class="icon-download-alt"></i> IMPORTAR<span> Importa os clientes a partir de um arquivo .CSV </span> </a></li>
            <li><a href="cadastrar_clientes.html"><i class="icon-plus-sign-alt"></i> CADASTRAR<span> Cadastro de clientes </span></a></li>
            <li><a href="listar_clientes.html"><i class="icon-list"></i> LISTAR<span> Lista os clientes com paginação </span> <span class="notify-tip">52</span></a></li>
            <li><a href="consultar_clientes.html"><i class="icon-search"></i> CONSULTAR<span> Consultar clientes com informações especificas </span></a></li>
          </ul>
        </div>
        <div class="tab-pane" id="contratos">
          <h4 class="side-head">CONTRATOS</h4>
          <ul class="accordion-nav">
            <li><a href="#"><i class="icon-asterisk"></i> NOVO<span>Gerar contrato novo</span></a></li>
            <li><a href="#"><i class="icon-copy"></i> REFINANCIAMENTOS</a></li>
            <li><a href="#"><i class="icon-list"></i> LISTAR<span>Lista os contratos com paginação</span> <span class="notify-tip">650</span></a></li>
            <li><a href="#"><i class="icon-search"></i> CONSULTAR<span>Consultar contratos a partir de dados específicos</a></li>
            <li><a href="#"><i class="icon-file"></i> PROTOCOLO<span>Gerar protocolo dos contratos</a></li>
          </ul>
        </div>
        <div class="tab-pane active" id="ui-elements">
          <h4 class="side-head">CONTACT CENTER</h4>
          <ul class="accordion-nav">
            <!--admAniversariantes-->
            <li><a href="?p=admContacCenter&opcao=list_ani&op_menu=ani" <?= $_GET['op_menu'] == 'ani' ? 'style="background:#fff; color:#da3610 !important;"' : ''; ?>><i class="icon-gift"></i> ANIVERSARIANTES </a></li>
            <li><a href="#"><i class="icon-circle-blank"></i> LISTA POR ORGÃO</a>
              <ul <?= $_GET['op_menu'] == 'lis' ? 'style="display: block;"' : ''; ?>>
                <li><a href="?p=admContacCenter&orgao=I&op_menu=lis" <?= $_GET['orgao'] == 'I' ? 'style="background:#fff; color:#da3610 !important;"' : ''; ?>><i class="icon-file-alt"></i> INSS</a></li>
                <li><a href="?p=admContacCenter&orgao=E&op_menu=lis" <?= $_GET['orgao'] == 'E' ? 'style="background:#fff; color:#da3610 !important;"' : ''; ?>><i class="icon-file-alt"></i> ESTADO</a></li>
                <li> <img src="images/imgOnOpen.png"> <a href="#"><i class="icon-file-alt"></i> PREFEITURAS</a>
                  <ul style="display: block;">
                    <li><a href="?p=admContacCenter&orgao=PN&op_menu=lis" <?= $_GET['orgao'] == 'PN' ? 'style="background:#fff; color:#da3610 !important;"' : ''; ?>><span><i class="icon-file-alt"></i> NATAL</span></a></li>
                    <li><a href="#"><span><i class="icon-file-alt"></i> PARNAMIRIM</span></a></li>
                    <li><a href="#"><span><i class="icon-file-alt"></i> MACAÍBA</span></a></li>
                  </ul>
                </li>
                <li><a href="#"><i class="icon-file-alt"></i> MILITAR</a></li>
                <li><a href="#"><i class="icon-file-alt"></i> FEDERAL</a></li>
                <li><a href="#"><i class="icon-file-alt"></i> CRÉDITO PESSOAL</a></li>
              </ul>
            </li>
            <li><a href="?p=admContacCenter&opcao=cCpf&op_menu=ccpf" <?= $_GET['op_menu'] == 'ccpf' ? 'style="background:#fff; color:#da3610 !important;"' : ''; ?>><i class="icon-search"></i> CONSULTA POR CPF</a></li>
            <li><a href="?p=admContacCenter&opcao=followup&op_menu=followup" <?= $_GET['op_menu'] == 'followup' ? 'style="background:#fff; color:#da3610 !important;"' : ''; ?>><i class="icon-share"></i> FOLLOW UP</a></li>
          </ul>
          <? if($_SESSION['estado']){
			  echo'
			<div class="thumbnail" style="border:0px;">
          		<a href="?p=admContacCenter&alt_estado=1">
					<img alt="'.$_SESSION['estado']['nome'].'" src="images/bandeiras/'.$_SESSION['estado']['url'].'" style="width: 100%;">
					<div class="caption">
					  <h5 align="center">'.$_SESSION['estado']['nome'].'</h5>
					</div>
            	</a>
			</div>
			';
		} ?>
        </div>
        <div class="tab-pane" id="relatorios">
          <h4 class="side-head">RELATÓRIOS</h4>
          <ul class="accordion-nav">
            <li><a href="#"><i class="icon-file-alt"></i> Acompanhamento<span>Relatório dos contratos em acompanhamento</span></a></li>
            <li><a href="#"><i class="icon-file-alt"></i> Pagos<span>Relatório dos contratos pago</span></a></li>
            <li><a href="#"><i class="icon-file-alt"></i> Produção<span>Relatório de produção por período</span></a></li>
          </ul>
        </div>
        <div class="tab-pane" id="simulador">
          <h4 class="side-head">SIMULADOR</h4>
          <ul class="accordion-nav">
            <li> <img src="images/imgOnOpen.png"> <a href="#"><i class="icon-home"></i> BANCOS</a>
              <ul style="display: block;">
                <li><a href="#1"><i class="icon-money"></i> BMG / SEMEAR</a></li>
                <li><a href="#1"><i class="icon-money"></i> GE / CIFRA</a></li>
                <li><a href="#1"><i class="icon-money"></i> SCHAIN</a></li>
                <li><a href="#2"><i class="icon-money"></i> BONSUCESSO</a></li>
                <li><a href="#3"><i class="icon-money"></i> MERCANTIL</a></li>
                <li><a href="#4"><i class="icon-money"></i> CRUZEIRO DO SUL</a></li>
                <li><a href="#5"><i class="icon-money"></i> BRADESCO</a></li>
              </ul>
            </li>
          </ul>
        </div>
        <div class="tab-pane" id="recibos">
          <h4 class="side-head">RECIBOS</h4>
          <ul class="accordion-nav">
            <li><a href="#"><i class="icon-plus-sign-alt"></i> GERAR RECIBO<span>Gerar recibos diversos</span></a></li>
            <li><a href="#"><i class="icon-list"></i> LISTAR<span>Lista os recibos gerados</span> </a></li>
            <li><a href="#"><i class="icon-search"></i> CONSULTAR<span>Consultar recibos a partir de dados específicos</a></li>
          </ul>
        </div>
        <div class="tab-pane" id="config">
          <h4 class="side-head">CONFIGURAÇÕES</h4>
          <ul class="accordion-nav">
            <!--<li><a href="#"><i class="icon-user"></i> USUÁRIOS</a>
              <ul>
                <li><a href="#"><i class="icon-plus-sign-alt"></i> Cadastrar</a></li>
                <li><a href="#"><i class="icon-list"></i> Listar</a></li>
              </ul>
            </li>
            <li><a href="#"><i class="icon-user"></i> CORRETORES</a>
              <ul>
                <li><a href="#"><i class="icon-plus-sign-alt"></i> Cadastrar</a></li>
                <li><a href="#"><i class="icon-list"></i> Listar</a></li>
              </ul>
            </li>
            <li><a href="#"><i class="icon-home"></i> LOJAS</a>
              <ul>
                <li><a href="#"><i class="icon-plus-sign-alt"></i> Cadastrar</a></li>
                <li><a href="#"><i class="icon-list"></i> Listar</a></li>
              </ul>
            </li>
            <li><a href="#"><i class="icon-list"></i> LOG USUÁRIOS</a></li>
            <li><a href="#"><i class="icon-calendar"></i> WEB PONTO</a></li>-->
            <li><a href="#"><i class="icon-unlock"></i> PERMISSÕES</a></li>
            <li><a href="#"><i class="icon-exclamation-sign"></i> IPS CONFIÁVEIS</a></li>
          </ul>
        </div>
      </div>
    </div>
  </div>
  <div class="main-wrapper">
    <?php
                    if (isset($_GET['p']) && file_exists($_GET['p'] . '.php')) {
                        include $_GET['p'] . '.php';
                    } else {
                       include"principal.php";
                    }
                    ?>
  </div>
  <div class="copyright">
    <p> <img src="images/orion_logo.png" width="60" style="position:relative; top:-5px;"> &copy; 2010 -
      <?=date('Y')?>
      $Prósper@ Empreendimentos </p>
  </div>
  <div class="scroll-top"> <a href="#" class="tip-top" title="Go Top"><i class="icon-double-angle-up"></i></a> </div>
</div>
</body>
</html>
<script type="text/javascript">

	// FUNÇÃO DATEPICKER
	function dtp(datep) {
		$("#"+datep).datetimepicker({
			pickTime: false
		});
	};
	
	
		function carregando(){
			$.gritter.add({
				// (string | mandatory) the heading of the notification
				title: "Aguarde!",
				// (string | mandatory) the text inside the notification
				text: 'Estamos execultando sua solicitação!'
			});
			//return false;
		}
	
	// BOTÃO SALVAR CONTATO
	function ccli(c) {
		// RETIRA O CLI_ DOS DADOS
		id = c.replace('cli_', '');
		
		if($("#dat" + id).val() > '<?=date('d/m/Y')?>'){
			// chama a função carregando
			carregando();
			
			//$("#icon_" + id).html('<img src="images/loading.gif" />');
			//******* VARIAVEIS *******//
			nome = $("#nome_"+id).html();
			cpf = $("#cpf_"+id).html();
			telefone = $("#telefone_"+id).html();
			agendado = $("#dat"+id).val();
			contato = $("#contato_"+id).val();
			obs = $("#obs_"+id).val();
			//*************************//
			
			$.ajax({
				type:'POST',
				data:{
					id: id,
					nome: nome,
					cpf: cpf,
					telefone: telefone,
					agendado: agendado,
					contato: contato,
					obs: obs,
					opcao: '1'
				},
				url: 'ajax/listaPorOrgao.php',
				success: function(r){
					$("#icon_" + id).html('');
					$("#"+c).css("color", "#900");
					$("#"+c).css("font-weight", "bold");
					$("#c"+c).css("display", "none");
				}
			});
		}
		else{
			bootbox.alert("A data para agendamento não pode ser menor ou igual a data atual!", function () {
				//callback
			});
		}
	};
	
	// BLOCO DE NOTAS
	function dcli(c) {
		bootbox.prompt("Bloco de notas", function (result) {
			
			// RETIRA O CLI_ DOS DADOS
			id = c.replace('cli_', '');
			cpf = $("#cpf_"+id).html();
			
			if (result === null) {
				//callback
			} else {
				//callback
				
				// grava as informações no banco
				$.ajax({
					type:'POST',
					data:{
						cpf: cpf,
						obs: result,
						opcao: '2'
					},
					url: 'ajax/listaPorOrgao.php',
					success: function(r){
						if(r == '1'){
							$("#btn_" + id).css("display", "inline-block");
						}
						else{
							bootbox.alert(r, function () {
								//callback
							});
						}
					}
				});
			}
		});
	}
</script>
<? mysqli_close($meubanco->id); ?>